﻿<%@ Page  UICulture="zh-CN" Language="C#" MasterPageFile="~/Default.master" Title="中转请求" AutoEventWireup="true" CodeBehind="TransferReq.aspx.cs" Inherits="FastShip88.TransferReq" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Main" runat="server">

    <div class="shim column"> </div>

     <div class="page" id="inbound_query">
          
		<div id="content_one_col">
            <asp:MultiView ID="multiView" runat="server" ActiveViewIndex="0">
            <asp:View ID = "vwStart" runat ="server" >
             <asp:Label ID="Label2" runat="server" Text="请选择以下操作：" CssClass="gv_prompt"></asp:Label>&nbsp;
            <br /><br />
                <asp:RadioButtonList ID="rdoChoice" runat="server" >
                    <asp:ListItem Value="create">创建新的中转请求</asp:ListItem>
                    <asp:ListItem Value="viewPending">查看未付款的中转请求记录</asp:ListItem>
                    <asp:ListItem Value="viewHistory">查看已付款的历史中转记录</asp:ListItem>
                </asp:RadioButtonList>
                
                <br /> <br />
                <asp:Button ID="btnContinue" runat="server" Text="继续" 
                    onclick="btnContinue_Click" />
            </asp:View>
            
            
            <asp:View ID ="viewCreateReq" runat ="server" >
                                            <asp:Label ID="Label1" runat="server" Text="下面列出所有到站包裹和合并包裹，不包含拆分的子包裹：" CssClass="gv_prompt"></asp:Label>&nbsp;
            <br /><br />
                            <asp:GridView ID="gvAvailParcels" runat="server" AutoGenerateColumns="False" 
                    DataKeyNames="Id" Width="780px"  
                    EmptyDataText="没有数据！" CellPadding="1" 
                    AllowPaging="True" PageSize="5" 
                    onpageindexchanging="gvResults_PageIndexChanging"  >
                    <Columns>

                       <asp:TemplateField ItemStyle-Width ="30px" >
                            <HeaderTemplate>
                                
                                选择
                             </HeaderTemplate><ItemTemplate>
                                <asp:CheckBox ID="chkSelect" runat="server"  />
                            </ItemTemplate>

                            <ItemStyle Width="30px" HorizontalAlign="Center"></ItemStyle>
                        </asp:TemplateField>
                        <asp:BoundField DataField="Id" HeaderText="系统编号" ReadOnly="True" >
                         <ItemStyle Width="60px" />
                         </asp:BoundField>

                        <asp:BoundField DataField="ParcelNo" HeaderText="运单号" ReadOnly="True" 
                            SortExpression="ParcelNo">
                        <ItemStyle Width="160px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Description" HeaderText="描述" ReadOnly="True" 
                            SortExpression="Description">
                        <ItemStyle Width="340px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Weight" HeaderText="重量" ReadOnly="True" 
                            SortExpression="Weight" Visible="True">
                        <ItemStyle Width="60px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="StatusName" HeaderText="状态">
                        <ItemStyle Width="100px" />
                        </asp:BoundField>
                        
                     </Columns>
                    <SelectedRowStyle BackColor="#669999"  />
                    <HeaderStyle BackColor="#999999" ForeColor="White" />
                </asp:GridView>
                
                <br />
                <br />
                
                
                <table style="width: 700px;">
 
 
                    <tr>
                        <td >
                            &nbsp;送货地址：
                        </td>
                        <td colspan="2">
                            &nbsp;
                            <asp:DropDownList ID="ddlAddrs" runat="server"  
                                DataTextField="Address" DataValueField="id" 
                                onselectedindexchanged="ddlAddrs_SelectedIndexChanged" AutoPostBack="true">
                            </asp:DropDownList><font color="#ff0000">*</font>
                        </td>
                       
                    </tr>
                           <tr>
                        <td>
                            &nbsp;收货人：
                        </td>
                        <td>
                            &nbsp; 
                            <asp:Label ID="lblReceiptor" runat="server" Text="Label"></asp:Label>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                           <tr>
                        <td>
                            &nbsp;中转留言，可不填：
                        </td>
                        <td colspan=2 >
                            &nbsp;<asp:TextBox ID="txtDescription" runat="server" Width="500px" Height="42px"></asp:TextBox>
                        </td>
                        
                    </tr>
               
                     <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td colspan=2>
                            &nbsp;
                        </td>
                        
                    </tr>
                 </table>
                
                
                
                
                <asp:Button ID="btnCreateReq" runat="server" Text="创建中转请求" onclick="btnCreateReq_Click" 
                                Width="90px" /> &nbsp; 
            
                <hr />

            
            </asp:View>
            
            <asp:View ID ="viewViewPending" runat ="server" >
                                            <asp:Label ID="lblUnpaidTransReq" runat="server" Text="下面列出未付款的中转请求：" 
                                                CssClass="gv_prompt"></asp:Label><asp:Label ID="lblPaidTransReq" runat="server" Text="下面列出已付款的中转请求：" 
                                                CssClass="gv_prompt"></asp:Label>&nbsp;
            <br /><br />
                    
                    <asp:GridView ID="gvPendingReq" runat="server" AutoGenerateColumns="False" 
                    DataKeyNames="Id" Width="780px"    EmptyDataText="没有数据！" CellPadding="1" 
                                                onselectedindexchanged="gvPendingReq_SelectedIndexChanged"  >
                    <Columns>

                        <asp:CommandField ShowSelectButton="True" />
                        <asp:BoundField DataField="Id" HeaderText="系统编号" ReadOnly="True" 
                            Visible="False" >
                         <ItemStyle Width="60px" />
                         </asp:BoundField>

                        <asp:BoundField DataField="ParcelNo" HeaderText="运单号" ReadOnly="True" 
                            SortExpression="ParcelNo" Visible="False">
                        <ItemStyle Width="160px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Description" HeaderText="描述" ReadOnly="True" 
                            SortExpression="Description">
                        <ItemStyle Width="300px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="ReqDate" HeaderText="创建日期" ReadOnly="True"  DataFormatString="{0:d}" >
                        <ItemStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TransferAddr" HeaderText="收货地址" ReadOnly="True" 
                            Visible="True">
                                                 <ItemStyle Width="340px" />

                        </asp:BoundField>
                        
                        <asp:BoundField DataField="UserBillId" HeaderText="付款单号" Visible="False">
                        <ItemStyle Width="80px" />
                        </asp:BoundField>
                        
                     </Columns>
                    <SelectedRowStyle BackColor="#669999"  />
                    <HeaderStyle BackColor="#999999" ForeColor="White" />
                </asp:GridView>

            
            <br />
            <div id ="divParcelsInReq" runat="server" >
            <br /> <asp:Label ID="Label5" runat="server" Text="下面列出该中转请求相关的包裹：" CssClass="gv_prompt"></asp:Label>&nbsp;
            <br /><br />
                                            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                                ConnectionString="<%$ ConnectionStrings:FastShip88ConnectionString %>" 
                                                SelectCommand="SELECT * FROM [ParcelInfos] WHERE ([TransferReqId] = @TransferReqId)">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="gvPendingReq" Name="TransferReqId" 
                                                        PropertyName="SelectedValue" Type="Int32" />
                                                </SelectParameters>
                                            </asp:SqlDataSource>
                            <asp:GridView ID="gvParcelsInReq" runat="server" AutoGenerateColumns="False" 
                    DataKeyNames="Id" Width="850px"   EmptyDataText="没有数据！" CellPadding="1"  DataSourceID="SqlDataSource1"  >
                    <Columns>

                        <asp:BoundField DataField="Id" HeaderText="系统编号" ReadOnly="True" >
                         <ItemStyle Width="60px" />
                         </asp:BoundField>

                        <asp:BoundField DataField="ParcelNo" HeaderText="入站运单号" ReadOnly="True" 
                            SortExpression="ParcelNo">
                        <ItemStyle Width="160px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Description" HeaderText="描述" ReadOnly="True" 
                            SortExpression="Description">
                        <ItemStyle Width="340px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Weight" HeaderText="重量" ReadOnly="True" 
                            SortExpression="Weight" Visible="True">
                        <ItemStyle Width="60px" />
                        </asp:BoundField>
                
                        <asp:BoundField DataField="OutParcelNo" HeaderText="出站运单号" ReadOnly="True" 
                            SortExpression="OutParcelNo">
                        <ItemStyle Width="160px" />
                        </asp:BoundField>
                     </Columns>
                    <SelectedRowStyle BackColor="#669999"  />
                    <HeaderStyle BackColor="#999999" ForeColor="White" />
                </asp:GridView>
                <br />
                <br />
                <asp:Button ID="btnPay4Pending" runat="server" Text="付款" onclick="btnPay4Pending_Click" />&nbsp; &nbsp;
                <asp:Button ID="btnCancelTransReq" runat="server" Text="取消中转" onclick="btnCancelTransReq_Click" />
            </div>
                <hr />

            
            </asp:View>
            
             <asp:View ID ="viewViewHistory" runat ="server" >
             </asp:View>  
             
             
                   
            <asp:View ID ="viewPay" runat ="server" >
            <br />
            <br />
                       <asp:Label ID="lblCreateReqSuccess" runat="server" Text="创建中转请求成功，请付款。" Font-Bold="True" 
              Font-Size="Medium" ForeColor= "Green" Height="30px" Visible="False" 
              Width="500px"></asp:Label>
            
              <div class="layout-main ">
                <div >
                    <UL>


                    <LI><SPAN >付款编号：</SPAN> 
                        <asp:Label ID="lblUserBillId" runat="server" Text=""></asp:Label>
                        </LI>
                    <LI><SPAN >付款金额：</SPAN> 
                        <asp:Label ID="lblTotalAmount" runat="server" Text="0"></asp:Label>
                        <SPAN >￥</SPAN> </LI></UL>
                    
                </div>
                
                <div id=div_default ><SPAN >
                    <B>请选择支付宝进行支付</B></SPAN> 
                    <br />

                    <asp:Label ID="Label4" runat="server" Text="" Width="300px" ></asp:Label>
                    <asp:ImageButton ID="imgAliPay" runat="server"   
                        ImageUrl="~/App_Themes/White/Images/pay_zhifubao.gif" 
                        onclick="imgAliPay_Click" /> 
                    
                    <br /> <br />
                 </div><!-- 选择其它银行或支付平台 -->

                 <div ><B>付款遇到问题：</B> 
                    <P>·付款时浏览器自动关闭怎么办？</P>
                    <P >答：点击Intenet选项,点击连接→局域网设置→高级→勾选 “对所有协议均使用相同的代理服务器”。</P>
                 </div>
                 
               </div>

             </asp:View>        

            
            </asp:MultiView>
            
            
             <asp:Label ID="lblError" runat="server" Text="出现错误" Font-Bold="True" 
              Font-Size="Medium" ForeColor="#CC0000" Height="30px" Visible="False" 
              Width="500px"></asp:Label>
                
            <asp:Label ID="lblSuccess" runat="server" Text="操作成功" Font-Bold="True" 
              Font-Size="Medium" ForeColor= "Green" Height="30px" Visible="False" 
              Width="500px"></asp:Label>

        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="OutsideForm" runat="server" >
<asp:Label ID="lbButton" runat="server"></asp:Label>
</asp:Content>
